# -*- coding: utf-8 -*-
from pathlib import Path
import itertools
import argparse
import os
'''
python diff.py --root /home/zgp/data/results/summe_canonical_sup_dslr1.00e-05_lr1.00e-04_clip5.0_slow15_hs2048_explr_2018/
'''
parser = argparse.ArgumentParser("diff score")

parser.add_argument('--root', type=str, required=True, help="root dir")
parser.add_argument('--fold-list', nargs='+', type=int, help='diff fold list', default=[1, 2, 3, 4, 5])
args = parser.parse_args()
print(args)

if __name__ == "__main__":
    for fold in args.fold_list:
        root = Path(args.root).joinpath(f'fold{fold}/score')
        sco_list = list(root.iterdir())
        for x, y in itertools.combinations(sco_list, 2):
            x = root.joinpath(x)
            y = root.joinpath(y)
            # print(f'{x} <-> {y}')
            os.system(f'diff {x} {y}')
